package chapter06;

import java.util.LinkedList;

public class Test03_Linklist {
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<>();
        //增加元素
        list.add("张三");
        list.add("李四");
        System.out.println(list);
        //插入元素
        list.add(1,"王五");
        System.out.println(list);
        //在首部增加元素
        list.offerFirst("Jack");
        System.out.println(list);
        //尾部增加
        list.offer("Rose");
        System.out.println(list);
        //删除
        list.remove(0);
        list.remove("Rose");
        System.out.println(list);
        //更改
        list.set(0,"赵六");
        System.out.println(list);
    }
}
